/********************************************
 * nsPerseusModule est le point             *
 * d'entrée du module, au lancement de      *
 * firefox la fonction NS_IMPL_NSGETMODULE  *
 * est recherchées et les composants sont   *
 * lancées                                  *
 *                                          *
 * *****************************************/

#include "nsIModule.h"
//#include "nsIGenericFactory.h"
#include "mozilla/ModuleUtils.h"
#include "nsICategoryManager.h"
#include "nsServiceManagerUtils.h"
#include "nsCURILoader.h"

#include "nsPerseusObserver.h"
#include "nsPerseusMime.h"

NS_GENERIC_FACTORY_CONSTRUCTOR(nsPerseusObserver)

NS_DEFINE_NAMED_CID(NS_PERSEUSOBSERVER_CID);
 static const mozilla::Module::CIDEntry kPerseusCIDs[] = {
     { &kNS_PERSEUSOBSERVER_CID, false, NULL, nsPerseusObserverConstructor },
     { NULL }
 };


static const mozilla::Module::ContractIDEntry kPerseusContracts[] = {
     { NS_PERSEUSOBSERVER_CONTRACTID , &kNS_PERSEUSOBSERVER_CID },
     { NULL }
};
/****************
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPerseusMime, init)


static NS_METHOD RegisterPerseusMime(nsIComponentManager *aCompMgr,
                                      nsIFile *aPath, 
                                      const char *registryLocation, 
                                      const char *componentType,
                                      const nsModuleComponentInfo *info)
{
    nsresult rv;
    nsCOMPtr<nsICategoryManager> catman = 
        do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
    NS_ENSURE_SUCCESS(rv, rv);

    char *previous;

    rv=catman->AddCategoryEntry(
                                NS_CONTENT_LISTENER_CATEGORYMANAGER_ENTRY,
                                "Perseus-init",
                                info->mContractID, PR_TRUE, PR_TRUE, &previous);
    NS_ENSURE_SUCCESS(rv, rv);

    LOG(("[Perseus extension] - [RegisterPerseusMime] Mime type register : ok"));
    return NS_OK;
}

*************/

  /******************************
   *                            *
   * Perseus : Table of         *
   *                Components  *
   *                            *
   *                            *     
   *****************************/
/*
static const nsModuleComponentInfo components[] =
{
  
{   "Perseus Mime Type registration (Perseus-init)", 
      NS_PERSEUSMIME_CID,
      NS_PERSEUSMIME_CONTRACTID,
      nsPerseusMimeConstructor,
      RegisterPerseusMime
    },

    { "Perseus Observer", 
      NS_PERSEUSOBSERVER_CID,
      NS_PERSEUSOBSERVER_CONTRACTID,
      nsPerseusObserverConstructor
    }
};
*/
static const mozilla::Module::CategoryEntry kPerseusCategories[] = {
    { "perseusobserver",  NS_PERSEUSOBSERVER_CONTRACTID , NS_PERSEUSOBSERVER_CONTRACTID },
    { NULL }
};

 /******************************
   *                            *
   * Perseus : Entry point      *
   *                            *
   *                            *     
   *****************************/
//NS_IMPL_NSGETMODULE(PERSEUS, components)
static const mozilla::Module kPerseusModule = {
    mozilla::Module::kVersion,
    kPerseusCIDs,
    kPerseusContracts,
    kPerseusCategories
 };
 // The following line implements the one-and-only "NSModule" symbol exported from this
 // shared library.
 NSMODULE_DEFN(nsSampleModule) = &kPerseusModule;
 
 // The following line implements the one-and-only "NSGetModule" symbol
 // for compatibility with mozilla 1.9.2. You should only use this
 // if you need a binary which is backwards-compatible and if you use
 // interfaces carefully across multiple versions.
NS_IMPL_MOZILLA192_NSGETMODULE(&kPerseusModule)
